<template>
  <h2>
    上传记录
  </h2>
  <a-table :pagination="false" :dataSource="clueStore.clueList" :columns="newColumns">
    <template #bodyCell="{ column, record }">
      <template v-if="column.key === 'file'">
        <audio controls v-if="record.file">
          <source :src="record.file" type="audio/wav"/>
          <a :href="record.file">
            Download audio
          </a>
        </audio>
        <span v-else>无录音</span>
      </template>
    </template>
  </a-table>
</template>
<script setup>
import {ref} from 'vue';
import {useClueStore} from "../stores/clue";
import {useSettingStore} from "../stores/setting";

const clueStore = useClueStore();
const settingStore = useSettingStore();

const newColumns = [
  {
    title: "日期",
    dataIndex: "date",
    key: "date",
  },
  {
    title: "姓名",
    dataIndex: "name",
    key: "name",
  },
  {
    title: "电话",
    dataIndex: "phone",
    key: "phone",
  },
  {
    title: "所在区域",
    dataIndex: "address",
    key: "address",
  },
  {
    title: "跟进",
    dataIndex: "remark",
    key: "remark",
  },
  {
    title: "录音",
    dataIndex: "file",
    key: "file",
  },
  {
    title: "提交结果",
    dataIndex: "response",
    key: "response",
  },
]

</script>
<style scoped lang="less">

</style>
